/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Splash.java
 *
 * Created on 06/08/2011, 12:07:40 PM
 */

package proyectocatalina;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;

/**
 *
 * @author principal
 */
public class Splash extends javax.swing.JFrame {    
     static int idsistema = 1;
     HiloProgreso hilo;
     public void centerScreen() {
            Dimension dim = this.getToolkit().getScreenSize();
            Rectangle abounds = this.getBounds();
            this.setLocation((dim.width - abounds.width) / 2,
            (dim.height - abounds.height) / 2);
            this.requestFocus();
     }
    /** Creates new form Splash */
    public Splash() {
       try {
            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }
    }
    } catch (Exception e) {
    // If Nimbus is not available, you can set the GUI to another look and feel.
    }
      
        setUndecorated(true);    
        initComponents();
        centerScreen();
        this.setLocationRelativeTo(null);
        this.setIconImage (new ImageIcon(getClass().getResource("/Imagenes/escudo.gif")).getImage());
         //Método por defecto  
    //Creamos un objeto HiloProgreso al cual
    //le pasamos por parámetro la barra de progreso
        hilo=new HiloProgreso(this);
    //Iniciamos el Hilo
        hilo.start();



  
    //Liberamos recursos   
        hilo=null;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setMinimumSize(new java.awt.Dimension(500, 300));
        setModalExclusionType(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
        setResizable(false);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/demo1.jpg"))); // NOI18N
        getContentPane().add(jLabel1, java.awt.BorderLayout.PAGE_END);

        getAccessibleContext().setAccessibleParent(this);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Splash().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

    /**
     * @param progreso the progreso to set
     */



    /**
     * @return the progreso
     */
  
}
